/** 
 * WindowMoveListener.java
 * @author Lex
 * 2007-9-5 ����03:07:43
 */
package lex.title.basic;

import java.awt.Window;
import java.awt.event.ComponentAdapter;
import java.awt.event.ComponentEvent;
import javax.swing.JRootPane;

class WindowMoveListener extends ComponentAdapter {
	private final PrimalWindowTitle titlePane;

	WindowMoveListener(PrimalWindowTitle pane) {
		this.titlePane = pane;
	}

	public void componentMoved(ComponentEvent e) {
		if (this.titlePane.getWindowDecorationStyle() == JRootPane.NONE) {
			return;
		}
		Window w = this.titlePane.getWindow();
		w.repaint(0, 0, w.getWidth(), 5);
	}

	public void componentResized(ComponentEvent e) {
		if (this.titlePane.getWindowDecorationStyle() == JRootPane.NONE) {
			return;
		}
		Window w = this.titlePane.getWindow();
		w.repaint(0, 0, w.getWidth(), 5);
	}
}